﻿<UserControl x:Class="LocultApp.Views.Pages.SettingsPages.About"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300"
             
             xmlns:Local="clr-namespace:LocultApp.Local"
             >
    <Grid>
        <Grid MinWidth="200" Margin="3">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="3" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Label Grid.Column="0" Grid.Row="0" Content="{x:Static Local:Strings.STR_ABOUT_Version}" ContentStringFormat="{}{0}:"
                       HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0" />
                <TextBlock Grid.Column="2" Grid.Row="0" Text="{Binding AppVersion,Mode=OneTime}"
                           Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />

                <Label Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center"
                       Content="{x:Static Local:Strings.STR_ABOUT_Copyright}" ContentStringFormat="{}{0}:" Margin="0" />
                <TextBlock Grid.Row="1" Grid.Column="2" Text="{Binding AssemblyCopyright, Mode=OneTime}"
                           Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center" />

                <Label Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center"
                       Content="{x:Static Local:Strings.STR_ABOUT_Link}" ContentStringFormat="{}{0}:" Margin="0" />
                <TextBlock Grid.Row="2" Grid.Column="2" Margin="0" HorizontalAlignment="Left" VerticalAlignment="Center">
                    <Hyperlink NavigateUri="{Binding ProjectHyperlink}" Command="{Binding BrowseAboutCommand}"
                               CommandParameter="{Binding ProjectHyperlink}"
                               >
                        <TextBlock Text="{Binding ProjectHyperlink}" HorizontalAlignment="Left" VerticalAlignment="Center" />
                    </Hyperlink>
                </TextBlock>
            </Grid>

            <Grid Grid.Row="1"
                      HorizontalAlignment="Stretch" VerticalAlignment="Top">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>

                <Label Grid.Row="0"
                           VerticalAlignment="Top" HorizontalAlignment="Left"
                           Content="{x:Static Local:Strings.STR_ABOUT_Modules}" ContentStringFormat="{}{0}:" Margin="0,3,0,0" />
                <Border Grid.Row="1" Margin="3,3,3,0"
                        BorderBrush="{DynamicResource {x:Static SystemColors.ActiveBorderBrushKey}}"
                        BorderThickness="1"
                         VerticalAlignment="Top">
                    <StackPanel>
                        <ListBox ItemsSource="{Binding Modules,Mode=OneTime}"
                                     MaxHeight="300">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <TextBlock Text="{Binding Value}" Margin="3,1,3,0" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                </Border>
            </Grid>

        </Grid>
    </Grid>
</UserControl>
